﻿@{
    ViewData["Title"] = "Index";
    Layout = "~/Areas/Console/Views/Shared/_Layout.cshtml";
}
@section head{
    <script type="text/javascript">
        var renderTable;
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'table', 'form', 'laydate'], function () {
            var $ = layui.$
                , form = layui.form
                , admin = layui.admin
                , table = layui.table
                , laydate = layui.laydate;

            renderTable = function () {
                table.render({
                    elem: '#table-datalist'
                    , id: "tableReload"
                    , url: '/Console/Reports/GetCrmGroupListJson'
                    , toolbar: false
                    , defaultToolbar: false
                    , limit: 20
                    , title: '数据表'
                    , cols: [[
                        { field: 'index', title: '序号', type: 'numbers', width: 60, templet: '#groupIndex' }
                        , { field: 'groupName', title: '分组名称' }
                        , { field: 'dealCount', title: '交易手数' }
                        , { field: 'volume', title: '交易量' }
                        , { field: 'profitAndLoss', title: '盈亏' }
                    ]]
                    , page: { layout: ['prev', 'page', 'next', 'refresh'] }
                    , done: function (res) {
                        if (res.count == 0) {
                            $(".layui-table-main").html('<div class="layui-none">' + top.lang.noData + '</div>');
                        }
                        layer.closeAll('loading');
                        /**多语言初始化 */
                        top.SetListPageLanguage(layui);
                    }
                });
            };
            //加载表格
            renderTable();
        });
    </script>
}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <table class="layui-hide" id="table-datalist" lay-filter="table-datalist"></table>
                    <script type="text/html" id="groupIndex">
                        {{d.LAY_TABLE_INDEX+1}}
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>